from config.tokens import zi_yin_token

def get_headers(systemName='ctms',name='xxx',pwd='xxx'):
    '''

    :param systemName: 系统名
    :param name: 自营平台账号
    :param pwd: 自营平台密码
    :return:
    '''
    if systemName == 'ctms':
        headers = {'content-type': 'application/json;charset=UTF-8',
                   'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36',
                   'token': 'xx=='
                   }
        return {'ip': 'https://xx', 'headers': headers}
    else:
        token = zi_yin_token(name, pwd)
        headers = {'content-type': 'application/json;charset=UTF-8',
                   'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36',
                   'token': token+'-'+name}
        return {'ip': 'http://xx', 'headers': headers}


# print(get_headers('自营平台'))
